<template>
  <div class="w-nav-height w-content-box web-feedback">
    <br />
    <w-table-view :list-data="listData">
      <template v-slot="scope">
        <w-cell
          :title="scope.item.name"
          :hover="false"
          :describe="scope.item.date | DateFormat"
          :detail="scope.item.content"
          :icon="scope.item.icon"
        />
      </template>
    </w-table-view>
  </div>
</template>

<script>
import { Api } from '@/config/api'
import WTableView from '@/components/global/tableview/customCell'
import WCell from '@/components/global/cell/cell_00'
export default {
  layout: 'web',
  name: 'WebFeedback',
  components: {
    WTableView,
    WCell
  },
  fetch ({ store }) {
    store.commit('app/SET_NAV_INDEX', '/web/feedback')
  },
  async asyncData ({ app, route }) {
    const { $wAxios } = app
    const data = await $wAxios.$get(Api.feedback.list, route.query)
    return { listData: data }
  },
  data () {
    return {}
  },
  watch: {
    async '$route.query' (query) {
      this.listData = await this.$wAxios.$get(Api.feedback.list, query)
    }
  },
  head () {
    return {
      title: '三人行必有我师焉'
    }
  }
}
</script>

<style lang="less">
.web-feedback {
  .title {
    font-size: 16px;
    color: #333;
    .time {
      color: #999;
    }
  }
  .content {
    font-size: 14px;
    margin-top: 4px;
    line-height: 20px;
  }
}
</style>
